package com.codegenerate.demo.utils;

import com.mysql.cj.util.StringUtils;

import java.time.LocalDateTime;
import java.util.Date;

public class NullUtils {
    public static boolean isNullNumber(int num) {
        return num <= 0;
    }
    public static boolean isNullNumber(long num) {
        return num <= 0;
    }
    public static boolean isNotNullNumber(long num) {
        return num > 0;
    }


    public static boolean isNullObject(Object iobj) {
        return iobj==null;
    }
    public static boolean isNotNullObject(Object iobj) {
        return !isNullObject(iobj);
    }

    public static boolean isNullString(String str) {
        return StringUtils.isNullOrEmpty(str);
    }
    public static boolean isNotNullString(String str) {
        return !isNullString(str);
    }
    public static boolean isNullDate(Date date) {
        return date==null;
    }
    public static boolean isNullDate(LocalDateTime date) {
        return date==null;
    }
    public static boolean isNotNullDate(Date date) {
        return !isNullDate(date);
    }


}
